<?php
use yii\helpers\Url;
?>
<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>铝邦CRM客户管理系统</title>
    <link rel="stylesheet" href="bootstrap/css/bootstrap.min.css"/>
    <link rel="stylesheet" href="bootstrap/css/bootstrap-datetimepicker.min.css"/>
    <link rel="stylesheet" href="css/common.css"/>
    <link rel="stylesheet" href="css/public.css"/>
    <link rel="stylesheet" href="css/setting.css"/>
    <script src="js/jquery-1.12.3.min.js"></script>
    <script src="bootstrap/js/bootstrap.min.js"></script>
    <script src="bootstrap/js/bootstrap-datetimepicker.min.js"></script>
    <script src="bootstrap/js/bootstrap-datetimepicker.zh-CN.js"></script>
    <script src="js/commer.js"></script>
    <script src="layui/layui.all.js"></script>
</head>
<body class="white">
<div class="part-top">
    <h3><?=$enterpriseDetail['enterpriseName']?></h3>
    <p>负责客服：<span><?=$enterpriseDetail['users']['userName']?></span></p>
    <p>跟进状态：<span><?=$enterpriseDetail['followStatus']['name']?></span></p>
    <div class="clear"></div>
    <div class="btn-wap">
        <div class="btn-comm" data-toggle="modal" data-target="#addContact">+添加联系</div>
        <div class="btn-comm" data-toggle="modal" data-target="#xappointClient">指派</div>
        <div class="btn-comm" data-toggle="modal" data-target="#addClient">编辑</div>
        <div class="btn-comm" data-toggle="modal" data-target="#delClient">删除</div>
    </div>
    <div class="clear"></div>
    <div class="sys-msg sys-on col-sm-1">基本信息</div>
    <div class="lx-msg col-sm-1">联系人</div>
    <div class="log-msg col-sm-1">操作日志</div>
    <div class="clear"></div>
</div>
<!--基本信息-->
<div class="main-left pull-left">
    <div class="msg-all">
        <h4>基本信息</h4>
        <div class="left-body">
            <label class="label-left-sm">企业账号：</label>
            <span><?=$enterpriseDetail['enterpriseAccount']?></span>
            <div class="clear"></div>
            <label class="label-left-sm">推荐人：</label>
            <span><?=$enterpriseDetail['recommender']?></span>
            <div class="clear"></div>
            <label class="label-left-sm">推荐人手机：</label>
            <span><?=$enterpriseDetail['recomCell']?></span>
            <div class="clear"></div>
            <label class="label-left-sm">法人：</label>
            <span><?=$enterpriseDetail['legalPerson']?></span>
            <div class="clear"></div>
            <label class="label-left-sm">负责人：</label>
            <span><?=$enterpriseDetail['responName']?></span>
            <div class="clear"></div>
            <label class="label-left-sm">公司类型：</label>
            <span><?=$enterpriseDetail['companyType']['typeName']?></span>
            <div class="clear"></div>
            <label class="label-left-sm">注册资金：</label>
            <span><?=$enterpriseDetail['registerBonus']?></span>
            <div class="clear"></div>
            <label class="label-left-sm">身份证是否法人/有无授权：</label>
            <span>
                <?php if($enterpriseDetail['idCardStatus']==1){
                    echo '否/无';
                }else if($enterpriseDetail['idCardStatus']==2){
                    echo '否/有授权';
                }else if($enterpriseDetail['idCardStatus']==3){
                    echo '是/无';
                }else if($enterpriseDetail['idCardStatus']==4){
                    echo '是/有授权';
                }
                ?>
            </span>
            <div class="clear"></div>
            <label class="label-left-sm">负责人是否和身份证一致：</label>
            <span>
                <?php if($enterpriseDetail['isSame']==1){
                    echo '是';
                }else{
                    echo '否';
                }
                ?>
                </span>
            <div class="clear"></div>
            <label class="label-left-sm">产品标准：</label>
            <span><?=$enterpriseDetail['productStandard']?></span>
            <div class="clear"></div>
            <label class="label-left-sm">主营产品：</label>
            <span><?=$enterpriseDetail['mainProduct']?></span>
            <div class="clear"></div>
            <label class="label-left-sm">产能/库存(吨)：</label>
            <span><?=$enterpriseDetail['stock']?></span>
            <div class="clear"></div>
            <label class="label-left-sm">月销售量(吨)：</label>
            <span><?=$enterpriseDetail['monthSale']?></span>
            <div class="clear"></div>
            <label class="label-left-sm">加工情况：</label>
            <span><?=$enterpriseDetail['processMsg']?></span>
            <div class="clear"></div>
            <label class="label-left-sm">主营地区：</label>
            <span><?=$enterpriseDetail['mainAddress']?></span>
            <div class="clear"></div>
        </div>
    </div>
    <div class="msg-cont">
        <h4>联系信息</h4>
        <div class="left-body">
            <label class="label-left-sm">电话：</label>
            <span><?=$enterpriseDetail['enterprisePhone']?></span>
            <div class="clear"></div>
            <label class="label-left-sm">传真：</label>
            <span><?=$enterpriseDetail['fax']?></span>
            <div class="clear"></div>
            <label class="label-left-sm">邮箱：</label>
            <span><?=$enterpriseDetail['email']?></span>
            <div class="clear"></div>
            <label class="label-left-sm">企业网站：</label>
            <span><?=$enterpriseDetail['enterpriseSite']?></span>
            <div class="clear"></div>
            <label class="label-left-sm">公司地址：</label>
            <span><?=$enterpriseDetail['address']?></span>
            <div class="clear"></div>
        </div>
    </div>
    <div class="msg-other">
        <h4>其他信息</h4>
        <div class="left-body">
            <label class="label-left-sm">负责人：</label>
            <span><?=$enterpriseDetail['users']['userName']?></span>
            <div class="clear"></div>
            <label class="label-left-sm">企业等级：</label>
            <span><?=$enterpriseDetail['enterpriseGrade']['name']?></span>
            <div class="clear"></div>
            <label class="label-left-sm">跟进状态：</label>
            <span><?=$enterpriseDetail['followStatus']['name']?></span>
            <div class="clear"></div>
            <label class="label-left-sm">创建时间：</label>
            <span><?=$enterpriseDetail['addTime']?></span>
            <div class="clear"></div>
            <label class="label-left-sm">最新跟进时间：</label>
            <span><?=$enterpriseDetail['lastFollowTime']?></span>
            <div class="clear"></div>
            <label class="label-left-sm">下次跟进时间：</label>
            <span><?=$enterpriseDetail['nextFollowTime']?></span>
            <div class="clear"></div>
            <label class="label-left-sm">备注：</label>
            <span><?=$enterpriseDetail['remarks']?></span>
            <div class="clear"></div>
        </div>
    </div>
</div>
<div class="main-right pull-left">
    <div class="follow-msg">
        <span>跟进状态</span>
        <div class="follow-btn" data-toggle="modal" data-target="#addFollow">+写跟进</div>
    </div>
    <div class="follow-msg-box">
        <?php foreach($followInfosList as $value){

            ?>
            <div class="follow-msg-wap">
                <span class="list-boll"></span>
                <div class="follow-time"><?=date('m-d',$value['addTime'])?></div>
                <div class="follow-sys">
                    <label>跟进人：</label>
                    <span><?=$value['users']['userName']?></span>
                    <span> > </span>
                    <span><?=$value['followType']['name']?></span>
                    <div class="clear"></div>
                    <span><?=$value['followContent']?></span>
                    <div class="clear"></div>
                    <label for="">配合程度：</label>
                    <span><?=$value['coordinationDegree']['name']?></span>
                    <div class="clear"></div>
                    <label for="">跟进状态：</label>
                    <span><?=$value['followStatus']['name']?></span>
                    <div class="clear"></div>
                    <label for="">跟进时间：</label>
                    <span><?=date('Y-m-d H:i',$value['followTime'])?></span>
                    <div class="clear"></div>
                    <div class="sys-del">删除</div>
                </div>
            </div>
            <?php
        }
        ?>

    </div>
</div>

<!--联系人-->
<div class="lx-wap" style="display:none;">
    <div class="table-wap">
        <table>
            <tr class="list-title">
                <td class="col-sm-1">姓名</td>
                <td class="col-sm-1">代理账号</td>
                <td class="col-sm-1">职务</td>
                <td class="col-sm-1">性别</td>
                <td class="col-sm-1">联系方式</td>
                <td class="col-sm-1">微信号</td>
                <td class="col-sm-1">QQ</td>
                <td class="col-sm-1">负责客服</td>
                <td class="col-sm-1 last-col">备注</td>
            </tr>
            <tr class="chk">
                <td class="col-sm-1"><a href="">林新生</a></td>
                <td class="col-sm-1">18955445002</td>
                <td class="col-sm-1">代理</td>
                <td class="col-sm-1">男</td>
                <td class="col-sm-1">18956246565</td>
                <td class="col-sm-1">adadd_dasd1</td>
                <td class="col-sm-1">-----</td>
                <td class="col-sm-1">aaa</td>
                <td class="col-sm-1 last-col">haoduohaoduohadoahdad</td>
            </tr>
            <tr class="chk">
                <td class="col-sm-1"><a href="">林新生</a></td>
                <td class="col-sm-1">18955445002</td>
                <td class="col-sm-1">代理</td>
                <td class="col-sm-1">男</td>
                <td class="col-sm-1">18956246565</td>
                <td class="col-sm-1">adadd_dasd1</td>
                <td class="col-sm-1">-----</td>
                <td class="col-sm-1">aaa</td>
                <td class="col-sm-1 last-col">haoduohaoduohadoahdad</td>
            </tr>
            <tr class="chk">
                <td class="col-sm-1"><a href="">林新生</a></td>
                <td class="col-sm-1">18955445002</td>
                <td class="col-sm-1">代理</td>
                <td class="col-sm-1">男</td>
                <td class="col-sm-1">18956246565</td>
                <td class="col-sm-1">adadd_dasd1</td>
                <td class="col-sm-1">-----</td>
                <td class="col-sm-1">aaa</td>
                <td class="col-sm-1 last-col">haoduohaoduohadoahdad</td>
            </tr>
        </table>
        <p class="page-col">共<span>7</span>条，共<span>1</span>页</p>
    </div>
    <div class="error-kong">
        <a href="contact.html">
        <div class="errorKong">
            <img src="images/unlucky.png"/>
            <p>还没有数据哦~</p>
        </div>
        </a>
    </div>
</div>
<!--写跟进弹框-->
<div class="modal" id="addFollow" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <form action="http://www.baidu.com" method="post">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                    <h4 class="modal-title add-title">写跟进</h4>
                </div>
                <div class="modal-body">

                    <select name="" id="followType" class="modal-select-fo">
                        <?php foreach($followTypeList as $value){

                            ?>
                            <option value="<?=$value['id']?>"><?=$value['name']?></option>
                            <?php
                        }
                        ?>

                    </select>
                    <input type="hidden" id="enterpriseId" value="<?=$enterpriseDetail['id']?>" />
                    <input id="followTime" class="span2 datetimepicker modal-input-fo" size="16" type="text" value="">
                    <div class="clear"></div>
                    <textarea id="followContent" name="" id="coordinationId" cols="30" rows="10" class="modal-text-fo"></textarea>
                    <div class="clear"></div>
                    <label class="modal-label">配合度：</label>
                    <select name="" id="coordinationId" class="modal-select-sm">
                        <option value="0">--请选择--</option>
                        <?php foreach($coordinationList as $value){

                            ?>
                            <option value="<?=$value['id']?>"><?=$value['name']?></option>
                            <?php
                        }
                        ?>
                    </select>
                    <label class="modal-label">跟进状态：</label>
                    <select name="" id="followStatus" class="modal-select-sm">
                        <option value="0">--请选择--</option>
                        <?php foreach($followStatusList as $value){

                            ?>
                            <option value="<?=$value['id']?>"><?=$value['name']?></option>
                            <?php
                        }
                        ?>
                    </select>
                    <div class="clear"></div>
                    <label class="modal-label">下次跟进时间：</label>
                    <input id="nextFollowTime" class="span2 datetimepicker modal-input-lg" size="16" type="text" value="">
                    <div class="clear"></div>

                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-primary" onclick="commitFollowInfo()">保存</button>
                    <button type="button" class="btn btn-default btn-qx" data-dismiss="modal">取消</button>
                </div>
        </form>
    </div>
</div>
</div>

<!--指派-->
<div class="modal" id="xappointClient" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title add-title">指派线索</h4>
            </div>
            <div class="modal-body">
                <form id="assignForm" action="" method="post" >
                    <label class="modal-label">新负责人：</label>
                    
                        <?php echo $this->render('../common/alldepartments',['departmentsList'=>$departmentsList]);?>
                        <input type="hidden" name="enterpriseId" value="<?=$enterpriseDetail['id']?>" >
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-primary" onclick="assignEnter()">保存</button>
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
            </div>
        </div>
    </div>
</div>
<!--删除-->
<div class="modal" id="delClient" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title add-title">提示</h4>
            </div>
         
            <div class="modal-body">
                <p class="modal-p">确定删除所选企业？该操作成功后，将无法恢复！</p>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-primary btn-del" onclick="delEnterprise()">确定删除</button>
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
            </div>
        </div>
    </div>
</div>
<<!--新增表单-->
<div class="modal" id="addClient" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title add-title">新增/编辑企业</h4>
            </div>
            <div class="modal-body">
                <form id="enterpriseForm" action="" method="post">
                    <label class="modal-label"><span class="red">*</span>企业名称：</label>
                    <input type="text" placeholder="" name="enterpriseName" id="enterpriseName" class="modal-input-lg"/>
                    <div class="clear"></div>
                    <label class="modal-label"><span class="red">*</span>企业账号：</label>
                    <input type="text" placeholder="" name="enterpriseAccount" id="enterpriseAccount" class="modal-input-lg"/>
                    <div class="clear"></div>
                    <label class="modal-label"><span class="red">*</span>法人：</label>
                    <input type="text" placeholder="" name="legalPerson" id="legalPerson" class="modal-input-lg"/>
                    <div class="clear"></div>
                    <label class="modal-label"><span class="red">*</span>负责人：</label>
                    <input type="text" placeholder="" name="responName" id="responName" class="modal-input-lg"/>
                    <div class="clear"></div>
                    <label class="modal-label"><span class="red">*</span>公司地址：</label>
                    <select name="provinceId" id="provinceId" class="modal-select-sm">
                        <option value="0">--省份--</option>
                        <?php foreach($provinceList as $key=>$value){

                            ?>
                            <option value="<?=$value['code']?>"><?=$value['name']?></option>

                            <?php
                        }
                        ?>
                    </select>
                    <select name="cityId" id="cityId" class="modal-select-sm">
                        <option value="0">--城市--</option>
                        <?php foreach($citiesList as $key=>$value){

                            ?>
                            <option value="<?=$value['code']?>"><?=$value['name']?></option>

                            <?php
                        }
                        ?>
                    </select>
                    <input name="address" id="address" class="modal-input-lg left-input" type="text"/>
                    <div class="clear"></div>
                    <label class="modal-label"><span class="red">*</span>公司类型：</label>
                    <select name="companyType" id="companyType" class="modal-select-sm">
                        <option value="0">--请选择--</option>
                        <?php foreach($companyCatsList as $key=>$value){

                            ?>
                            <option value="<?=$value['id']?>"><?=$value['typeName']?></option>

                            <?php
                        }
                        ?>
                    </select>
                    <div class="clear"></div>
                    <label class="modal-label"><span class="red">*</span>联系人：</label>
                    <input type="text" name="contactName" id="contactName" class="modal-input-lg"/>
                    <div class="clear"></div>
                    <label class="modal-label"><span class="red">*</span>联系电话：</label>
                    <input type="text" placeholder="" name="phone" id="phone" class="modal-input-lg"/>
                    <div class="clear"></div>
                    <label class="modal-label-lo"><span class="red">*</span>身份证是否为法人/有无授权：</label>
                    <select name="idCardStatus" id="personImpower" class="modal-select-sm modal-lo">
                        <option value="0">--请选择--</option>
                        <option value="1">否/无</option>
                        <option value="2">否/有授权</option>
                        <option value="3">有/无</option>
                    </select>
                    <div class="clear"></div>
                    <label class="modal-label-lo"><span class="red">*</span>负责人是否和身份证一致：</label>
                    <select name="isSame" id="isSame" class="modal-select-sm modal-lo">
                        <option value="0">--请选择--</option>
                        <option value="1">是</option>
                        <option value="2">否</option>
                    </select>
                    <div class="clear"></div>
                    <div class="many-wap">
                        <label class="modal-label">下次跟进时间：</label>
                        <input class="span2 datetimepicker modal-input-lg" name="nextFollowTime" id="nextFollowTime" size="16" type="text" value="">
                        <div class="clear"></div>
                        <label class="modal-label">负责客服：</label>
                        <select name="departmentId" id="departmentId" class="modal-select-sm" onchange="getDepartmentList(this)">
                            <option value="0">--部门--</option>
                            <?php foreach($departmentList as $value){

                                ?>
                                <option value="<?=$value['id']?>" ><?=$value['departName']?></option>

                                <?php foreach($value['twoGrade'] as $twoValue){
                                    ?>
                                    <option value="<?=$twoValue['id']?>">-<?=$twoValue['departName']?></option>
                                    <?php
                                    foreach($twoValue['threeGrade'] as $threeValue){
                                        ?>
                                        <option value="<?=$threeValue['id']?>">--<?=$threeValue['departName']?></option>
                                        <?php
                                        foreach($threeValue['fourGrade'] as $fourValue){
                                            ?>
                                            <option value="<?=$fourValue['id']?>">---<?=$fourValue['departName']?></option>
                                            <?php
                                            foreach($fourValue['fiveGrade'] as $fiveValue){

                                                ?>

                                                <option value="<?=$fiveValue['id']?>">----<?=$fiveValue['departName']?></option>
                                            <?php } ?>
                                            <?php
                                        } ?>
                                    <?php    } ?>
                                <?php } ?>

                            <?php } ?>
                        </select>
                        <select name="responUserId" id="responUserId" class="modal-select-sm">
                            <option value="0">--员工--</option>

                        </select>
                        <script>
                            function getDepartmentList(object){
                                var params={};
                                params.departmentId=$(object).val();
                                console.log(params);
                                var url="<?=Url::toRoute(['system/department-list'])?>";
                                $.post(url,params,function(data){
                                    var data=JSON.parse(data);
                                    var str='';
                                    data.forEach(function(v){
                                        str+='<option value="'+v['id']+'">'+v['userName']+'</option>';
                                    });
                                    console.log(str);
                                    $(object).next().html(str);
                                });

                            }
                        </script>
                        <div class="clear"></div>
                        <label class="modal-label">申请时间：</label>
                        <input class="span2 datetimepicker modal-input-lg start" name="applyTime" id="applyTime" size="16" type="text" value="">
                        <div class="clear"></div>
                        <label class="modal-label">通过时间：</label>
                        <input class="span2 datetimepicker modal-input-lg end" name="passTime" id="passTime" size="16" type="text" value="">
                        <div class="clear"></div>
                        <label class="modal-label">推荐人：</label>
                        <input type="text" name="recommender" id="recommender" class="modal-input-lg"/>
                        <div class="clear"></div>
                        <label class="modal-label">推荐人手机：</label>
                        <input type="text" name="recomCell" id="recomCell" class="modal-input-lg"/>
                        <div class="clear"></div>
                        <label class="modal-label">注册资金(万元)：</label>
                        <input type="text" name="registerBonus" id="registerBonus" class="modal-input-lg"/>
                        <div class="clear"></div>
                        <label class="modal-label">电话：</label>
                        <input type="text" name="enterprisePhone" id="enterprisePhone" class="modal-input-lg"/>
                        <div class="clear"></div>
                        <label class="modal-label">传真：</label>
                        <input type="text" name="fax" id="fax" class="modal-input-lg"/>
                        <div class="clear"></div>
                        <label class="modal-label">邮箱：</label>
                        <input type="text" name="email" id="email" class="modal-input-lg"/>
                        <div class="clear"></div>
                        <label class="modal-label">企业网站：</label>
                        <input type="text" name="enterpriseSite" id="enterpriseSite" class="modal-input-lg"/>
                        <div class="clear"></div>
                        <label class="modal-label">主营产品：</label>
                        <input type="text" name="mainProducts" id="mainProducts" class="modal-input-lg"/>
                        <div class="clear"></div>
                        <label class="modal-label">产品标准：</label>
                        <input type="text" name="standardId" id="standardId" class="modal-input-lg"/>
                        <div class="clear"></div>
                        <label class="modal-label">产能/库存(吨)：</label>
                        <input type="text" name="stock" id="stock" class="modal-input-lg"/>
                        <div class="clear"></div>
                        <label class="modal-label">月销售量(吨)：</label>
                        <input type="text" name="monthSale" id="monthSale" class="modal-input-lg"/>
                        <div class="clear"></div>
                        <label class="modal-label">加工情况：</label>
                        <input type="text" name="processMsg" id="processMsg" class="modal-input-lg"/>
                        <div class="clear"></div>
                        <label class="modal-label">主营地区：</label>
                        <input type="text" name="mainAddress" id="mainAddress" class="modal-input-lg"/>
                        <div class="clear"></div>
                        <label class="modal-label-bz">备&emsp;&emsp;注：</label>
                        <textarea name="remarks" id="remarks" cols="30" rows="10"></textarea>
                        <div class="clear"></div>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn-default btn many">展开更多信息</button>
                <button type="button" class="btn btn-primary" onclick="commitEnterprise()">保存</button>
                <button type="button" class="btn btn-default btn-qx" data-dismiss="modal">取消</button>
            </div>
        </div>
    </div>
</div>
<!--编辑联系-->
<!--<div class="modal" id="editContact" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title add-title">编辑联系</h4>
            </div>
            <div class="modal-body">
                <form action="" method="post">
                    <label class="modal-label"><span class="red">*</span>姓名：</label>
                    <input type="text" placeholder="" name="addname" class="modal-input-lg"/>
                    <div class="clear"></div>
                    <label class="modal-label"><span class="red">*</span>所属企业：</label>
                    <input class="modal-input-lg" type="text"/>
                    <div class="clear"></div>
                    <label class="modal-label">联系方式：</label>
                    <input type="text" name="" class="modal-input-lg"/>
                    <div class="clear"></div>
                    <label class="modal-label">职务：</label>
                    <input type="text" placeholder="" class="modal-input-lg"/>
                    <div class="clear"></div>
                    <label class="modal-label">性别：</label>
                    <select name="" id="" class="modal-select-sm">
                        <option value="0">--请选择--</option>
                        <option value="1">男</option>
                        <option value="2">女</option>
                        <option value="3">其他</option>
                    </select>
                    <div class="clear"></div>
                    <label class="modal-label">微信号：</label>
                    <input type="text" name="" class="modal-input-lg"/>
                    <div class="clear"></div>
                    <label class="modal-label">QQ：</label>
                    <input type="text" name="" class="modal-input-lg"/>
                    <div class="clear"></div>
                    <label class="modal-label-bz">备&emsp;&emsp;注：</label>
                    <textarea name="" id="" cols="30" rows="10"></textarea>
                    <div class="clear"></div>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-primary">保存</button>
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
            </div>
        </div>
    </div>
</div>-->
<!--新增联系-->
<div class="modal" id="addContact" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title add-title">新增联系</h4>
            </div>
            <div class="modal-body">
                <form id="contactForm" action="" method="post">
                    <label class="modal-label"><span class="red">*</span>姓名：</label>
                    <input type="text" placeholder="" name="addname" class="modal-input-lg"/>
                    <div class="clear"></div>
                    <label class="modal-label"><span class="red">*</span>所属企业：</label>
                    <input class="modal-input-lg" type="text"/>
                    <div class="clear"></div>
                    <label class="modal-label">联系方式：</label>
                    <input type="text" name="" class="modal-input-lg"/>
                    <div class="clear"></div>
                    <label class="modal-label">职务：</label>
                    <input type="text" placeholder="" class="modal-input-lg"/>
                    <div class="clear"></div>
                    <label class="modal-label">性别：</label>
                    <select name="" id="" class="modal-select-sm">
                        <option value="0">--请选择--</option>
                        <option value="1">男</option>
                        <option value="2">女</option>
                        <option value="3">其他</option>
                    </select>
                    <div class="clear"></div>
                    <label class="modal-label">微信号：</label>
                    <input type="text" name="" class="modal-input-lg"/>
                    <div class="clear"></div>
                    <label class="modal-label">QQ：</label>
                    <input type="text" name="" class="modal-input-lg"/>
                    <div class="clear"></div>
                    <label class="modal-label-bz">备&emsp;&emsp;注：</label>
                    <textarea name="" id="" cols="30" rows="10"></textarea>
                    <div class="clear"></div>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-primary">保存</button>
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
            </div>
        </div>
    </div>
</div>
<script>
 $(".lx-msg").click(function () {
        $(".sys-msg").removeClass("sys-on");
        $(this).addClass("sys-on");
        $(".main-left").css("display","none");
        $(".main-right").css("display","none");
        $(".lx-wap").css("display","block");
    });
    $(".sys-msg").click(function () {
        $(".lx-msg").removeClass("sys-on");
        $(this).addClass("sys-on");
        $(".main-left").css("display","block");
        $(".main-right").css("display","block");
        $(".lx-wap").css("display","none");
    })
    $("#addFollow").modal({
        keyboard:false,
        show:false
    });
    $("#xappointClient").modal({
        keyboard:false,
        show:false
    });
    $("#delClient").modal({
        keyboard:false,
        show:false
    });
    $("#editContact").modal({
        keyboard:false,
        show:false
    });
    $("#addContact").modal({
        keyboard:false,
        show:false
    });
    $("#addFollow").click(function () {
        var date = new Date();
        var y = date.getFullYear();
        var m = date.getMonth()+1;
        var d = date.getDate();
        var h = date.getHours();
        var f = date.getMinutes();
        var time = y+"-"+m+"-"+d+" "+h+":"+f;
        $(".modal-input-fo").val(time);
    });
   
    function commitFollowInfo(){
        var params={};
        params.type=2;
        params.enterpriseId=$('#enterpriseId').val();
        params.followType=$('#followType').val();
        params.followTime=$('#followTime').val();
        params.followContent=$('#followContent').val();
        params.coordinationId=$('#coordinationId').val();
        params.followStatus=$('#followStatus').val();
        params.nextFollowTime=$('#nextFollowTime').val();
        var url="<?=Url::toRoute(['follow-infos/edit-follow-info'])?>";
        $.post(url,params,function(data){
            var data=JSON.parse(data);
            if(data.errcode==0){
                alert(data.errmsg);
                window.location.reload();
            }else{
                alert(data.errmsg);
            }
        });


    }
    /**
     * 新增联系人
     */
    function commitContact(){
        var params=$('#contactForm').serialize();
        var url="<?=Url::toRoute(['contact-people/edit-contact-peopled'])?>)";
        $.post(url,$params,function(data){
            var data=JSON.parse(data);
            if(data.errcode==0){
                layer.msg(data.errmsg);
                window.location.reload();
            }else{
                layer.msg(data.errmsg);
            }
        });
    }
     /**
         * 详情页指派联系人
         */
        function assignEnter(){
            var params=$('#assignForm').serialize();

            var url="<?=Url::toRoute(['enterprises/assign-enter'])?>";
            $.post(url,params,function(data){
                var data=JSON.parse(data);
                if(data.errcode==0){
                    layer.msg(data.errmsg);
                    window.location.reload();
                }else{
                    layer.msg(data.errmsg);
                }
            });
        }
         /**
         * 删除联系人
         */
        function delEnterprise(){
            var url="<?=Url::toRoute(['enterprises/del-enterprise'])?>";
            var enterpriseId="<?=$enterpriseDetail['id']?>";
            $.post(url,{'enterpriseId':enterpriseId},function(data){
                var data=JSON.parse(data);
                if(data.errcode==0){
                    layer.msg(data.errmsg);
                    window.location.href="<?=Url::toRoute(['enterprises/index'])?>";
                }else{
                    layer.msg(data.errmsg);
                }
            });
        }
</script>
</body>
</html>